#include <stdio.h>
int main(void)
{
    int i, n, x, cnt, a, b, c;
    scanf("%d", &n);
    cnt = 0;
    for(i = 0; i < n; i++)
    {
        scanf("%d", &x);
        a = x / 100 % 10;
        b = x / 10 % 10;
        c = x % 10;
        if(a * a * a + b * b * b + c * c * c == x)
        {
            cnt++;
        }
    }
    printf("%d", cnt);
    return 0;
}

